<#if isRoot>
[{
	"text": "<a href='#'>产品类型</a>",
	"classes": "folder"
	<#if list?size gt 0>,
		"expanded": true,
		"children": [
			<#list list as tree>
				{
					"id": "${tree.typeId}",
					"text": "<a href='#' onclick='type_selected(${tree.typeId},\"${tree.name}\"})'>${tree.name}</a>",
					"classes": "<#if tree.leaf gt 0>folder<#else>file</#if>",
					"hasChildren": <#if tree.leaf gt 0>true<#else>false</#if>
				}<#if tree_has_next>,</#if>
			</#list>
		]
	</#if>
}]
<#else>
	[
	<#list list as tree>
		{
		"id": "${tree.typeId}",
		"text": "<a href='#' onclick='type_selected(${tree.typeId},\"${tree.name}\")'>${tree.name}</a>",
		"classes": "<#if tree.leaf gt 0>folder<#else>file</#if>",
		"hasChildren": <#if tree.leaf gt 0>true<#else>false</#if>
		}<#if tree_has_next>,</#if>
	</#list>
	]
</#if>
